package com.example.workhandling;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    Button myBtn1;
    TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.buttonevent);

        myBtn1 = (Button) findViewById(R.id.btn1); //绑定
        textView = (TextView)findViewById(R.id.textview);
        myBtn1.setOnClickListener(v->{
            textView.setText("(Lambda表达式)按钮被点击！");
        });
    }
}
